-
Notifications
You must be signed in to change notification settings - Fork 1k
Polish translation of the Scala tutorial #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Whoa! Yes! Another translation!! 😄 By any chance, is there anyone you could suggest that would be able to review this translation? |
…everal minor corrections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Polish community should be really grateful for this. I left small comments about particular wording or translations but nothing really big.
I didn't have time to read it twice, so I think at least one more reviewer should take part in it.
tutorial-previous: currying | ||
--- | ||
|
||
Scala wspiera mechanizm _klas case_. Klasy case są zwykłymi klasami z dodatkowymi założeniami: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this translation of case class
has previously appeared anywhere or has been discussed? I know it is very hard to translate such names, but klasa case
doesn't sound very well. Sadly, I don't have any obviously better one. Klasy przypadków
has been used here: http://www.scala-lang.org/docu/files/ScalaTutorial-pl_PL.pdf and I think it sound a little better, but still not perfect...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, klasy przypadków
sounds more natural. I wasn't sure if I should translate terms that are unique for Scala, but if it was translated before then I guess we should use this term.
|
||
Scala wspiera mechanizm _klas case_. Klasy case są zwykłymi klasami z dodatkowymi założeniami: | ||
|
||
* Domyślnie immutable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have met pretty good translation of immutable
to niemutowalny
or (slightly worse in my opinion) niezmienny
. Is there a reason to use english word for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
immutable
or niezmienny
seems to be commonly used on Polish forums, but niemutowalny
sounds very nice, I think we can use that instead.
} | ||
``` | ||
|
||
Klasa `Stack` modeluje zmienny stos z zawierający elementy dowolnego typu `T`. Parametr `T` narzuca ograniczenie dla metod takie, że tylko elementy typu `T` mogą zostać dodane do stosu. Podobnie metoda `top` może zwrócić tylko elementy danego typu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant z
in stos z zawierający
tutorial-previous: implicit-parameters | ||
--- | ||
|
||
Konwersja implicit z typu `S` do `T` jest określona przez wartość implicit, która jest funkcją typu `S => T` lub przez metodę implicit odpowiadającą funkcji tego typu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar case like with klasy case
. Have you considered translating implicit
? I think people tend to use niejawne
for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this, but niejawne
in Polish suggests something that is just opposite of explicit. This might work for implicit conversions, but for implicit parameters we should probably use domniemany
since implicit here means more like something that is implied.
W poniższym przykładzie zdefiniujemy metodę `sum`, która oblicza sumę listy elementów wykorzystując operacje `add` i `unit` obiektu `Monoid`. Należy dodać, że wartości implicit nie mogą być zdefiniowane globalnie, tylko muszą być elementem pewnego modułu. | ||
|
||
```tut | ||
/** Ten przykład wykorzystuje strukturę z algebry abstrakcyjnej aby zilustrować działanie parametrów implicit. Półgrupa jest strukturą algebraiczną na zbiorze A z łączna (która spełnia warunek: add(x, add(y, z)) == add(add(x, y), z)) operacją nazwaną add, która łączy parę obiektów A by zwrócić inny A. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
łączna
instead of łączną
tutorial-previous: traits | ||
--- | ||
|
||
W przeciwieństwie do języków które wspierają jedynie pojedyncze dziedziczenie, Scala posiada bardziej uogólniony mechanizm ponownego wykorzystania klas. Scala umożliwia na wykorzystanie _nowych elementów klasy_ (różnicy w stosunku do klasy bazowej) w definicji nowej klasy. Wyraża się to przy pomocy _kompozycji domieszek_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other places we use cecha
as translation of trait
and here it's changed to domieszka
. I think cecha
is much better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
domieszka
is a Polish term for mixin
(see Wikipedia page) which is something different than just trait
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I haven't seen it before. Sorry :)
tutorial-previous: higher-order-functions | ||
--- | ||
|
||
Scala pozwala na zagnieżdżanie definicji funkcji. Poniższy obiekt określa funkcję `filter`, która dla danej listy filtruje elementy większe bądź równe niż podany próg `threshold`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filtruje elementy większe bądź równe niż podany próg
I think it should be filtruje elementy większe bądź równe podanemu progowi
|
||
## Companion ## | ||
|
||
Duża część obiektów singleton nie istnieje samodzielnie, ale jest powiązana z klasą o tej samej nazwie. Obiekt singleton generowany dla klasy case jest tego przykładem. Kiedy tak się dzieje, obiekt singleton jest zwany *obiektem companion* (co oznacza, że jest _towarzyszem_ tej klasy). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can consider obiekt towrzyszący
instead of obiekt companion
as it sound a bit more natural, IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though about obiekt towarzysz
which sounded a bit awkward but I like obiekt towarzyszący
, I think we can use this translation.
} | ||
``` | ||
|
||
Bardzo powszechne jest użycie wzorca typeclass w połączeniu z [wartościami implicit](implicit-parameters.html), takich jak `ipord` powyżej, zdefiniowanych w obiekcie companion. Dzieje się tak, ponieważ elementy obiektu companion są włączone w procesie wyszukiwania domyślnych wartości implicit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elementy obiektu companion są włączone w procesie wyszukiwania
Maybe uwzględniane
instead of włączone
?
tutorial-previous: variances | ||
--- | ||
|
||
W Scali [parametry typów](generic-classes.html) oraz [typy abstrakcyjne](abstract-types.html) mogą być warunkowane przez ograniczenia typów. Tego rodzaju ograniczenia pomagają określić konkretne wartości zmiennych typu oraz odkryć więcej informacji na temat elementów tych typów. _Ograniczenie górne typu_ `T <: A` zakładają, że zmienna `T` odwołuje się jest podtypem typu `A`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
że zmienna
T
odwołuje się jest podtypem typuA
.
Redundant odwołuje się
Thank you @Krever for your review. I've added your suggestions to the translation, it's definitely much better now! |
no other reviewer has appeared, so let's just merge. it can always be improved further again. thanks again! |
For some reason there is no link to it in language list on the right side, but I can see that it's deployed now. Is there something else I should add to make it available? It worked fine when I was running it on my machine. |
hopefully fixed in dca716f once it finishes deploying. if not let me know |
fix is not live, because #680 |
tutorial-previous: inner-classes | ||
--- | ||
|
||
W Scali, klasy są parametryzowane wartościami (parametry konstruktora) oraz typami (jeżeli klasa jest [generyczna](generic-classes.html)). Aby zachować regularność, zarówno typy jak i wartości są elementami klasy. Analogicznie mogą one być konkretne albo abstrakcyjne. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be ,
after Scali
, tbh.
} | ||
``` | ||
|
||
Cechy oraz [klasy](classes.html) z abstrakcyjnymi typami są często używane w połączeniu z anonimowymi klasami. Aby to zilustrować wykorzystamy program, w którym utworzymy bufor sekwencji ograniczony do listy liczb całkowitych: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider adding comma after zilustrować
.
|
||
Typ zwracany przez metodę `newIntSeqBuf` nawiązuje do specjalizacji cechy `Buffer`, w której typ `U` jest równy `Int`. Podobnie w anonimowej klasie tworzonej w metodzie `newIntSeqBuf` określamy `T` jako `List[Int]`. | ||
|
||
Warto zwrócić uwagę na to, że często jest możliwa zamiana abstrakcyjnych typów w parametry typów klas i odwrotnie. Poniższy przykład stosuje wyłącznie parametry typów: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without na to
it would sound better,
|
||
Adnotację stosuje się do pierwszej definicji lub deklaracji która po niej następuje. Możliwe jest zastosowanie więcej niż jednej adnotacji przed definicją lub deklaracją. Kolejność według której są one określone nie ma istotnego znaczenia. | ||
|
||
Znaczenie adnotacji jest zależne od implementacji. Na platformie Java, poniższe adnotacje domyślnie oznaczają: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be comma after Java
.
public class MyClass extends HisClass ... | ||
``` | ||
|
||
W tym przypadku, Scala daje taką samą możliwość: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without comma after przypadku
.
SMS is: SMS(12345, Hello!) | ||
``` | ||
|
||
Jednym z najważniejszych zastosowań klas przypadków (skąd też się wzięła ich nazwa), jest **dopasowanie wzorca**. Poniższy przykład pokazuje działanie funkcji, która zwraca różne komunikaty, w zależności od rodzaju powiadomienia: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without comma before jest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also I wouldn't insert it after komunikaty
.
|
||
``` | ||
|
||
Programując w Scali, zachęca się abyś jak najszerzej używał klas przypadków do modelowania danych, jako że kod który je wykorzystuje jest bardziej ekspresywny i łatwiejszy do utrzymania: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wykorzystujący je kod
or kod, który je wykorzystuje, jest bardziej
Programując w Scali, zachęca się abyś jak najszerzej używał klas przypadków do modelowania danych, jako że kod który je wykorzystuje jest bardziej ekspresywny i łatwiejszy do utrzymania: | ||
|
||
* Obiekty niemutowalne uwalniają cię od potrzeby śledzenia zmian stanu | ||
* Porównanie przez wartość pozwala na porównywanie instancji tak jakby były prymitywnymi wartościami |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's needed a comma somewhere. Likely before jakby
.
} | ||
``` | ||
|
||
Program definiuje wykonywalną aplikację w postaci [obiektu singleton](singleton-objects.html) z główną metodą `main`. Metoda `main` tworzy nową instancję typu `Point` i zapisuje ją do wartości `pt`. Istotną rzeczą jest to, że wartości zdefiniowane z użyciem słowa kluczowego `val` różnią się od zmiennych określonych przez `var` (jak w klasie `Point` powyżej), tym że nie dopuszczają aktualizacji ich wartości. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comma should be before że
, not before tym
.
tutorial-previous: regular-expression-patterns | ||
--- | ||
|
||
W Scali, wzorce mogą być zdefiniowane niezależnie od klas przypadków. Obiekt posiadający metodę `unapply` może funkcjonować jako tak zwany ekstraktor. Jest to szczególna metoda, która pozwala na odwrócenie zastosowania obiektu dla pewnych danych. Jego celem jest ekstrakcja danych, z których został on utworzony. Dla przykładu, poniższy kod definiuje ekstraktor dla [obiektu](singleton-objects.html) `Twice`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without comma after Scali
.
I know I'm late to the party (too late). But I quickly and briefly looked through the part of translated files. You can take this into account in case of some follow-up PR, if you want. :) And, personally, to me it's a bit strange to read technical stuff in Polish. ;) Esp. that it's anyway Polish - English - PolGlish mix (it has to be like that). :) But there was quite a lot of things to translate so really good job! Edit: I can take a look at the rest of files but not now. And I'm looking rather at the wording and the punctuation than at the general context. |
Seth, it's hard to expect that reviewers will appear without the explicit invitation in case of (no offense :) ) such a niche repo as scala.github.com. ;) |
iirc, I did ask for reviewers on Gitter. Is there some other way we should have publicized it? I don't think it quite rises to the level where it makes sense for scala_lang to tweet about it. in general, on translations, it's usually the submitter who has the best chance of bringing in reviewers themselves, since they know people in their own language community. |
|
in general, I think all of us — but especially the Scala team — could do more to alert the community to PRs that need a little love. I do it maybe once a week on Gitter, but I could probably be doing more like once a day. I'll try to keep it in mind. I sometimes wonder if there ought to be a more regular and/or formal channel for this. maybe a weekly “help wanted” post to contributors.scala-lang.org, something like that. idk |
Maybe ask on The bot could also single out a random user to ask, Hey, @ Jo, would you be interested in helping with a PR? That would be so embarrassing and so great. |
@mpociecha Thanks for having a look at this, I'm really poor at punctuation :). I'll apply your suggestions soon in another PR (maybe along with translation of the new Basics page). |
@adamwy In meantime I'll finish reading this one since I was somewhere in the middle, I think. :) In case of Basics or other future translations you can ping me. It may be definitely more effective if I'll create PRs against your branches with suggested fixes to punctuation instead of forcing you to apply each of them manually. ;) |
@adamwy Honestly, finally I realised (better late than never ;) ) that it doesn't make sense to add comments to the already merged PR. I'll just create PR with my suggestions and will "add" you as a reviewer. |
This is a complete translation of the Scala tutorial into the Polish language.